import React from 'react';
import { Button, Checkbox, Form, Input } from 'antd';

export default function EditPassword() {
  const onFinish = (values: any) => {
    console.log('Success:', values);
  };

  const onFinishFailed = (errorInfo: any) => {
    console.log('Failed:', errorInfo);
  };

  return (
    <Form
      name="password"
      labelCol={{ span: 8 }}
      wrapperCol={{ span: 8 }}
      initialValues={{ remember: true }}
      onFinish={onFinish}
      onFinishFailed={onFinishFailed}
      autoComplete="off"
    >
      <Form.Item
        label="旧密码"
        name="oldPassword"
        rules={[{ required: true, message: '输入旧密码!' }]}
      >
        <Input.Password />
      </Form.Item>
      <Form.Item
        label="新密码"
        name="newPassword"
        rules={[{ required: true, message: '输入新密码!' }]}
      >
        <Input.Password />
      </Form.Item>
      <Form.Item
        label="确认新密码"
        name="againPassword"
        rules={[{ required: true, message: '再次输入新密码' }]}
      >
        <Input.Password />
      </Form.Item>
      <Form.Item wrapperCol={{ offset: 10, span: 4 }}>
        <Button type="primary" htmlType="submit">
          保存
        </Button>
      </Form.Item>
    </Form>
  );
}
